package com.hornsun.domain.constant.types;

/**
 * Created by 编译中... on 2018/9/3.
 */
public enum  LoginType {
    ADMIN_LOGIN(1,"管理员登录"),
    DOCTOR_LOGIN(2,"医生登录");

    private Integer type;
    private String name;

    LoginType(Integer type ,String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static LoginType fromName(String name) {
        for (LoginType loginType : values()) {
            if (loginType.name.equals(name)){
                return loginType;
            }
        }
        return null;
    }

    public static LoginType fromType(Integer type) {
        for (LoginType loginType : values()) {
            if (loginType.type.equals(type)){
                return loginType;
            }
        }
        return null;
    }
}
